/*
 * Ext GWT - Ext for GWT
 * Copyright(c) 2007-2009, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */
package com.hy.mydesktop.client.rpcModel;

import com.extjs.gxt.ui.client.data.BaseModel;

public class RPCGroupGrid extends BaseModel {

	/**
	 * <ul>
	 * <li>开发作者：冬超</li>
	 * <li>设计日期：2010-9-29；时间：上午09:15:03</li>
	 * <li>字段类型：long；字段名称：serialVersionUID</li>
	 * <li>设计目的：</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 */
	private static final long serialVersionUID = 1L;

	public RPCGroupGrid() {
	}

	public RPCGroupGrid(String name, String symbol, double open, double last) {
		set("name", name);
		set("symbol", symbol);
		set("open", open);
		set("last", last);
		set("change", last - open);
	}

	public RPCGroupGrid(String name, double open, double change,
			double pctChange, String industry) {
		set("name", name);
		set("open", open);
		set("change", change);
		set("percentChange", pctChange);
		set("industry", industry);
	}

	public String getIndustry() {
		return get("industry");
	}

	public void setIndustry(String industry) {
		set("industry", industry);
	}

	public String getName() {
		return (String) get("name");
	}

	public String getSymbol() {
		return (String) get("symbol");
	}

	public double getOpen() {
		Double open = (Double) get("open");
		return open.doubleValue();
	}

	public double getLast() {
		Double open = (Double) get("last");
		return open.doubleValue();
	}

	public double getChange() {
		return getLast() - getOpen();
	}

	public double getPercentChange() {
		return getChange() / getOpen();
	}

	public String toString() {
		return getName();
	}

}